/**
 * @(#)InterceptInfoDAOImpl.java 2016年4月20日
 * Copyright(C) 2015 ZHEXIN IT CO.,LTD. All rights reserved.
 */
package org.jsbd.boss.dao.impl;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jsbd.boss.common.DataGridModel;
import org.jsbd.boss.dao.IInterceptInfoDAO;
import org.jsbd.boss.domian.InterceptInfo;

import edu.hziee.common.dbroute.BaseDAO;

/**
 * @author <a href="mailto:luoyaxi@zhexinit.com" >罗雅锡</a>
 * @version 1.0.0
 */
public class InterceptInfoDAOImpl extends BaseDAO implements IInterceptInfoDAO{

	@Override
	public Map<String, Object> selectInterceptInfoPageListMap(DataGridModel model,
			InterceptInfo form) {
		form =(form==null?new InterceptInfo():form);
	    form.setPageInfo(model);
	    Map<String, Object> map = new HashMap<String, Object>();
	    map.put("total", super.queryForCount("qy_intercept.select_qy_intercept_page_list_count", form));
	    map.put("rows", super.queryForList("qy_intercept.select_qy_intercept_page_list", form));
	    return map;
	}

	@Override
	public int insertInterceptInfo(InterceptInfo form) {
		Object obj = super.insert("qy_intercept.insert_qy_intercept", form);
	    return obj == null?0:(Integer)obj;
	}

	@Override
	public int updateInterceptInfo(InterceptInfo form) {
		if (form == null) {
			return 0;
		}
		    
		return super.update("qy_intercept.update_qy_intercept", form);
	}
	
	 @Override
	  public InterceptInfo findIfInterceptExist(InterceptInfo form) {
	    return (InterceptInfo) super.queryForObject("qy_intercept.find_if_qy_intercept_exist", form);
	  }
	
	@Override
	public InterceptInfo findInterceptInfo(InterceptInfo form){
		return (InterceptInfo) super.queryForObject("qy_intercept.select_qy_intercept", form);
	}
	
    @Override
    public List<InterceptInfo> selectInterceptInfoList(InterceptInfo form) {
      return super.queryForList("qy_intercept.select_qy_intercept_list", form);
    }
	@Override
	public InterceptInfo findInterceptInfoByid(String id){
		return (InterceptInfo) super.queryForObject("qy_intercept.select_qy_intercept_byid", id);
	}
	
}
